home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cuj9205
/
1005048b
< prev
next >
Wrap
Text File
|
1992-06-02
|
396b
|
18 lines
Listing 2. Code for a simple filter
void simple_filter(double *x, double *y, int N,
double a, double b)
{
double y0 = 0, y1 = 0;
int i = 0;
for(; i < N; i++)
{
y[i] = a*y0 + b*y1 + x[i];
y1 = y0;
y0 = y[i];
}
}